.class public Lcom/netease/newsreader/service/OfflineDownloadService;
.super Landroid/app/Service;
.source "OfflineDownloadService.java"


# instance fields
.field private appdata:Lcom/netease/newsreader/activity/MyApplication;

.field private db:Landroid/database/sqlite/SQLiteDatabase;

.field private downloadsum:I

.field private failedcount:I

.field private handler:Landroid/os/Handler;

.field private imageDownloader:Lcom/netease/newsreader/util/BaseImageDownloader;

.field private notifiManager:Landroid/app/NotificationManager;

.field private notification:Landroid/app/Notification;

.field private pIntent:Landroid/app/PendingIntent;

.field private remoteView:Landroid/widget/RemoteViews;

.field private tidList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private tnameList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 42
    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    .line 47
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->tidList:Ljava/util/ArrayList;

    .line 48
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->tnameList:Ljava/util/ArrayList;

    .line 52
    iput v1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->downloadsum:I

    .line 53
    iput v1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->failedcount:I

    .line 360
    new-instance v0, Lcom/netease/newsreader/service/OfflineDownloadService$1;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/service/OfflineDownloadService$1;-><init>(Lcom/netease/newsreader/service/OfflineDownloadService;)V

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->handler:Landroid/os/Handler;

    .line 42
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/service/OfflineDownloadService;Landroid/app/PendingIntent;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 46
    iput-object p1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->pIntent:Landroid/app/PendingIntent;

    return-void
.end method

.method static synthetic access$1(Lcom/netease/newsreader/service/OfflineDownloadService;IILjava/lang/String;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 59
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/newsreader/service/OfflineDownloadService;->setNotification(IILjava/lang/String;)V

    return-void
.end method

.method static synthetic access$10(Lcom/netease/newsreader/service/OfflineDownloadService;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 48
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->tnameList:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$11(Lcom/netease/newsreader/service/OfflineDownloadService;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 53
    iput p1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->failedcount:I

    return-void
.end method

.method static synthetic access$12(Lcom/netease/newsreader/service/OfflineDownloadService;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 485
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/newsreader/service/OfflineDownloadService;->insertListToDB(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$13(Lcom/netease/newsreader/service/OfflineDownloadService;)Lcom/netease/newsreader/util/BaseImageDownloader;
    .locals 1
    .parameter

    .prologue
    .line 51
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->imageDownloader:Lcom/netease/newsreader/util/BaseImageDownloader;

    return-object v0
.end method

.method static synthetic access$14(Lcom/netease/newsreader/service/OfflineDownloadService;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 52
    iput p1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->downloadsum:I

    return-void
.end method

.method static synthetic access$15(Lcom/netease/newsreader/service/OfflineDownloadService;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 589
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/newsreader/service/OfflineDownloadService;->insertTopicListToDB(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$2(Lcom/netease/newsreader/service/OfflineDownloadService;)Landroid/widget/RemoteViews;
    .locals 1
    .parameter

    .prologue
    .line 43
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->remoteView:Landroid/widget/RemoteViews;

    return-object v0
.end method

.method static synthetic access$3(Lcom/netease/newsreader/service/OfflineDownloadService;)Landroid/app/NotificationManager;
    .locals 1
    .parameter

    .prologue
    .line 45
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notifiManager:Landroid/app/NotificationManager;

    return-object v0
.end method

.method static synthetic access$4(Lcom/netease/newsreader/service/OfflineDownloadService;)Landroid/app/Notification;
    .locals 1
    .parameter

    .prologue
    .line 44
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notification:Landroid/app/Notification;

    return-object v0
.end method

.method static synthetic access$5(Lcom/netease/newsreader/service/OfflineDownloadService;)I
    .locals 1
    .parameter

    .prologue
    .line 52
    iget v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->downloadsum:I

    return v0
.end method

.method static synthetic access$6(Lcom/netease/newsreader/service/OfflineDownloadService;)I
    .locals 1
    .parameter

    .prologue
    .line 53
    iget v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->failedcount:I

    return v0
.end method

.method static synthetic access$7(Lcom/netease/newsreader/service/OfflineDownloadService;)Lcom/netease/newsreader/activity/MyApplication;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->appdata:Lcom/netease/newsreader/activity/MyApplication;

    return-object v0
.end method

.method static synthetic access$8(Lcom/netease/newsreader/service/OfflineDownloadService;)Ljava/util/ArrayList;
    .locals 1
    .parameter

    .prologue
    .line 47
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->tidList:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$9(Lcom/netease/newsreader/service/OfflineDownloadService;)Landroid/os/Handler;
    .locals 1
    .parameter

    .prologue
    .line 360
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->handler:Landroid/os/Handler;

    return-object v0
.end method

.method private initNotification()V
    .locals 1

    .prologue
    .line 56
    const-string v0, "notification"

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/service/OfflineDownloadService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notifiManager:Landroid/app/NotificationManager;

    .line 57
    return-void
.end method

.method private insertListToDB(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V
    .locals 27
    .parameter
    .parameter "columnID"
    .parameter "type"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 486
    .local p1, data:Ljava/util/List;,"Ljava/util/List<Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const-string v4, ""

    .line 487
    .local v4, docid:Ljava/lang/String;
    const-string v5, ""

    .line 488
    .local v5, imgsrc:Ljava/lang/String;
    const-string v6, ""

    .line 489
    .local v6, digest:Ljava/lang/String;
    const-string v8, ""

    .line 490
    .local v8, url:Ljava/lang/String;
    const-string v7, ""

    .line 491
    .local v7, replyCount:Ljava/lang/String;
    const-string v9, ""

    .line 492
    .local v9, title:Ljava/lang/String;
    const-string v10, ""

    .line 493
    .local v10, ptime:Ljava/lang/String;
    const-string v14, "0"

    .line 494
    .local v14, hasimg:Ljava/lang/String;
    const-string v24, ""

    .line 495
    .local v24, latestTime:Ljava/lang/String;
    const-string v15, ""

    .line 496
    .local v15, specialid:Ljava/lang/String;
    const-string v16, ""

    .line 497
    .local v16, sepcialindex:Ljava/lang/String;
    const-string v17, ""

    .line 498
    .local v17, sepcialtname:Ljava/lang/String;
    const-string v18, ""

    .line 499
    .local v18, extendjson:Ljava/lang/String;
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "select * from news_list where news_col_id=\'"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 500
    move-object/from16 v0, p2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\' order by news_ptime desc limit 0,1"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    .line 499
    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v25

    .line 501
    .local v25, s:Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/String;

    move-object/from16 v0, v25

    invoke-virtual {v2, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v19

    .line 502
    .local v19, c:Landroid/database/Cursor;
    if-eqz v19, :cond_0

    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-lez v2, :cond_0

    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_0

    const-string v2, "news_ptime"

    move-object/from16 v0, v19

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v2

    move-object/from16 v0, v19

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v24

    .line 503
    :cond_0
    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->close()V

    .line 505
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V

    .line 506
    const-string v2, "head"

    move-object/from16 v0, p3

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 507
    invoke-static/range {p2 .. p2}, Lcom/netease/newsreader/util/Tools;->equalHead(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    .line 512
    :cond_1
    const/16 v22, 0x0

    .local v22, i:I
    :goto_0
    :try_start_0
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v2

    move/from16 v0, v22

    if-lt v0, v2, :cond_2

    .line 580
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 585
    :goto_1
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 587
    return-void

    .line 514
    :cond_2
    :try_start_1
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "docid"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_11

    .line 515
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "docid"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    .line 516
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "select * from news_list where news_doc_id=? and news_col_id=\'"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 518
    move-object/from16 v0, p2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\'"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    .line 516
    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v26

    .line 519
    .local v26, sql:Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/String;

    const/4 v11, 0x0

    aput-object v4, v3, v11

    move-object/from16 v0, v26

    invoke-virtual {v2, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v20

    .line 522
    .local v20, cursor:Landroid/database/Cursor;
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "imgsrc"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_3

    .line 523
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "imgsrc"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v5

    .line 525
    :cond_3
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "digest"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_4

    .line 526
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "digest"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v6

    .line 528
    :cond_4
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "replyCount"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_5

    .line 529
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "replyCount"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    .line 531
    :cond_5
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "url"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_6

    .line 532
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "url"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v8

    .line 534
    :cond_6
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "title"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_7

    .line 535
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "title"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v9

    .line 537
    :cond_7
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "ptime"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_8

    .line 538
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "ptime"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v10

    .line 540
    :cond_8
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "hasImg"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_9

    .line 541
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "hasImg"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v14

    .line 543
    :cond_9
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "specialID"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_a

    .line 544
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "specialID"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v15

    .line 546
    :cond_a
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "index"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_b

    .line 547
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "index"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v16

    .line 549
    :cond_b
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "tname"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_c

    .line 550
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "tname"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v17

    .line 552
    :cond_c
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "extendjson"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_d

    .line 553
    move-object/from16 v0, p1

    move/from16 v1, v22

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/HashMap;

    const-string v3, "extendjson"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v18

    .line 557
    :cond_d
    if-eqz v20, :cond_e

    invoke-interface/range {v20 .. v20}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-nez v2, :cond_12

    .line 558
    :cond_e
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 559
    const-string v11, ""

    const-string v12, "0"

    const-string v13, "N"

    move-object/from16 v3, p2

    .line 558
    invoke-static/range {v2 .. v18}, Lcom/netease/newsreader/db/DBUtils;->insertDataToNewsListTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 567
    :goto_2
    if-eqz v20, :cond_f

    .line 568
    invoke-interface/range {v20 .. v20}, Landroid/database/Cursor;->close()V

    .line 570
    :cond_f
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    move/from16 v0, v22

    if-ne v0, v2, :cond_11

    const-string v2, ""

    move-object/from16 v0, v24

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_10

    move-object/from16 v0, v24

    invoke-static {v10, v0}, Lcom/netease/newsreader/util/StringUtil;->compareDate(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_11

    :cond_10
    const-string v2, "nonhead"

    move-object/from16 v0, p3

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_11

    .line 571
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v11, "delete from news_list where news_col_id=\'"

    invoke-direct {v3, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p2

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v11, "\' and news_ptime<\'"

    invoke-virtual {v3, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v11, "\'"

    invoke-virtual {v3, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 512
    .end local v20           #cursor:Landroid/database/Cursor;
    .end local v26           #sql:Ljava/lang/String;
    :cond_11
    :goto_3
    add-int/lit8 v22, v22, 0x1

    goto/16 :goto_0

    .line 563
    .restart local v20       #cursor:Landroid/database/Cursor;
    .restart local v26       #sql:Ljava/lang/String;
    :cond_12
    new-instance v23, Landroid/content/ContentValues;

    invoke-direct/range {v23 .. v23}, Landroid/content/ContentValues;-><init>()V

    .line 564
    .local v23, initialValues:Landroid/content/ContentValues;
    const-string v2, "news_reply_count"

    move-object/from16 v0, v23

    invoke-virtual {v0, v2, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 565
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    const-string v3, "news_list"

    const-string v11, "news_doc_id=?"

    const/4 v12, 0x1

    new-array v12, v12, [Ljava/lang/String;

    const/4 v13, 0x0

    aput-object v4, v12, v13

    move-object/from16 v0, v23

    invoke-virtual {v2, v3, v0, v11, v12}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2

    .line 575
    .end local v20           #cursor:Landroid/database/Cursor;
    .end local v23           #initialValues:Landroid/content/ContentValues;
    .end local v26           #sql:Ljava/lang/String;
    :catch_0
    move-exception v21

    .line 577
    .local v21, e:Ljava/lang/Exception;
    :try_start_2
    invoke-virtual/range {v21 .. v21}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_3

    .line 581
    .end local v21           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v21

    .line 583
    .restart local v21       #e:Ljava/lang/Exception;
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    goto/16 :goto_1
.end method

.method private insertTopicListToDB(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V
    .locals 24
    .parameter
    .parameter "columnID"
    .parameter "more"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")V"
        }
    .end annotation

    .prologue
    .line 590
    .local p1, topicData:Ljava/util/List;,"Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;"
    const-string v4, ""

    .line 591
    .local v4, docid:Ljava/lang/String;
    const-string v5, ""

    .line 592
    .local v5, imgsrc:Ljava/lang/String;
    const-string v6, ""

    .line 593
    .local v6, digest:Ljava/lang/String;
    const-string v8, ""

    .line 594
    .local v8, url:Ljava/lang/String;
    const-string v7, ""

    .line 595
    .local v7, replyCount:Ljava/lang/String;
    const-string v9, ""

    .line 596
    .local v9, title:Ljava/lang/String;
    const-string v10, ""

    .line 597
    .local v10, ptime:Ljava/lang/String;
    const-string v11, ""

    .line 598
    .local v11, subtitle:Ljava/lang/String;
    const-string v14, "0"

    .line 599
    .local v14, hasimg:Ljava/lang/String;
    const-string v15, ""

    .line 600
    .local v15, specialid:Ljava/lang/String;
    const-string v16, ""

    .line 601
    .local v16, sepcialindex:Ljava/lang/String;
    const-string v17, ""

    .line 602
    .local v17, sepcialtname:Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V

    .line 604
    const/16 v21, 0x0

    .local v21, i:I
    :goto_0
    :try_start_0
    invoke-interface/range {p1 .. p1}, Ljava/util/List;->size()I

    move-result v2

    move/from16 v0, v21

    if-lt v0, v2, :cond_0

    .line 663
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 668
    :goto_1
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 670
    return-void

    .line 606
    :cond_0
    :try_start_1
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "docid"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_a

    .line 607
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "docid"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    .line 608
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "select * from news_list where news_doc_id=? and news_col_id=\'"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 610
    move-object/from16 v0, p2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\'"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    .line 608
    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v23

    .line 611
    .local v23, sql:Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/String;

    const/4 v12, 0x0

    aput-object v4, v3, v12

    move-object/from16 v0, v23

    invoke-virtual {v2, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v19

    .line 613
    .local v19, cursor:Landroid/database/Cursor;
    if-eqz v19, :cond_1

    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-lez v2, :cond_1

    if-eqz v21, :cond_1

    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 614
    const-string v2, "news_is_first"

    move-object/from16 v0, v19

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v2

    move-object/from16 v0, v19

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    const-string v3, "1"

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 616
    new-instance v22, Landroid/content/ContentValues;

    invoke-direct/range {v22 .. v22}, Landroid/content/ContentValues;-><init>()V

    .line 617
    .local v22, initialValues:Landroid/content/ContentValues;
    const-string v2, "news_is_first"

    const-string v3, "0"

    move-object/from16 v0, v22

    invoke-virtual {v0, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 618
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    const-string v3, "news_list"

    const-string v12, "news_doc_id=?"

    const/4 v13, 0x1

    new-array v13, v13, [Ljava/lang/String;

    const/16 v18, 0x0

    aput-object v4, v13, v18

    move-object/from16 v0, v22

    invoke-virtual {v2, v3, v0, v12, v13}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    .line 621
    .end local v22           #initialValues:Landroid/content/ContentValues;
    :cond_1
    if-eqz v19, :cond_2

    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-nez v2, :cond_9

    .line 622
    :cond_2
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "imgsrc"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_3

    .line 623
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "imgsrc"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v5

    .line 625
    :cond_3
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "url"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_4

    .line 626
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "url"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v8

    .line 628
    :cond_4
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "title"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_5

    .line 629
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "title"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v9

    .line 631
    :cond_5
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "ptime"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_6

    .line 632
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "ptime"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v10

    .line 634
    :cond_6
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "subtitle"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_7

    .line 635
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "subtitle"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v11

    .line 637
    :cond_7
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "speciaID"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_8

    .line 638
    move-object/from16 v0, p1

    move/from16 v1, v21

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map;

    const-string v3, "speciaID"

    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v15

    .line 641
    :cond_8
    if-nez v21, :cond_b

    const-string v2, "more"

    move-object/from16 v0, p3

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_b

    .line 642
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 643
    const-string v12, "1"

    const-string v13, "N"

    .line 644
    const-string v18, ""

    move-object/from16 v3, p2

    .line 642
    invoke-static/range {v2 .. v18}, Lcom/netease/newsreader/db/DBUtils;->insertDataToNewsListTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 653
    :cond_9
    :goto_2
    if-eqz v19, :cond_a

    .line 654
    invoke-interface/range {v19 .. v19}, Landroid/database/Cursor;->close()V

    .line 604
    .end local v19           #cursor:Landroid/database/Cursor;
    .end local v23           #sql:Ljava/lang/String;
    :cond_a
    :goto_3
    add-int/lit8 v21, v21, 0x1

    goto/16 :goto_0

    .line 646
    .restart local v19       #cursor:Landroid/database/Cursor;
    .restart local v23       #sql:Ljava/lang/String;
    :cond_b
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 647
    const-string v12, "0"

    const-string v13, "N"

    .line 648
    const-string v18, ""

    move-object/from16 v3, p2

    .line 646
    invoke-static/range {v2 .. v18}, Lcom/netease/newsreader/db/DBUtils;->insertDataToNewsListTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_2

    .line 658
    .end local v19           #cursor:Landroid/database/Cursor;
    .end local v23           #sql:Ljava/lang/String;
    :catch_0
    move-exception v20

    .line 660
    .local v20, e:Ljava/lang/Exception;
    :try_start_2
    invoke-virtual/range {v20 .. v20}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_3

    .line 664
    .end local v20           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v20

    .line 666
    .restart local v20       #e:Ljava/lang/Exception;
    move-object/from16 v0, p0

    iget-object v2, v0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    goto/16 :goto_1
.end method

.method private setNotification(IILjava/lang/String;)V
    .locals 3
    .parameter "layoutId"
    .parameter "picId"
    .parameter "desc"

    .prologue
    .line 60
    new-instance v0, Landroid/widget/RemoteViews;

    invoke-virtual {p0}, Lcom/netease/newsreader/service/OfflineDownloadService;->getPackageName()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1, p1}, Landroid/widget/RemoteViews;-><init>(Ljava/lang/String;I)V

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->remoteView:Landroid/widget/RemoteViews;

    .line 61
    new-instance v0, Landroid/app/Notification;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    invoke-direct {v0, p2, p3, v1, v2}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notification:Landroid/app/Notification;

    .line 62
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notification:Landroid/app/Notification;

    iput p2, v0, Landroid/app/Notification;->icon:I

    .line 63
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notification:Landroid/app/Notification;

    iget-object v1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->remoteView:Landroid/widget/RemoteViews;

    iput-object v1, v0, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;

    .line 64
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notification:Landroid/app/Notification;

    iget-object v1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->pIntent:Landroid/app/PendingIntent;

    iput-object v1, v0, Landroid/app/Notification;->contentIntent:Landroid/app/PendingIntent;

    .line 65
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->notification:Landroid/app/Notification;

    const/16 v1, 0x10

    iput v1, v0, Landroid/app/Notification;->flags:I

    .line 66
    return-void
.end method


# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 1
    .parameter "arg0"

    .prologue
    .line 71
    const/4 v0, 0x0

    return-object v0
.end method

.method public onCreate()V
    .locals 6

    .prologue
    .line 77
    invoke-super {p0}, Landroid/app/Service;->onCreate()V

    .line 79
    invoke-virtual {p0}, Lcom/netease/newsreader/service/OfflineDownloadService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/activity/MyApplication;

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->appdata:Lcom/netease/newsreader/activity/MyApplication;

    .line 80
    invoke-direct {p0}, Lcom/netease/newsreader/service/OfflineDownloadService;->initNotification()V

    .line 81
    iget-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->appdata:Lcom/netease/newsreader/activity/MyApplication;

    invoke-virtual {v0}, Lcom/netease/newsreader/activity/MyApplication;->getSQLiteDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 83
    const/16 v3, 0x6e

    .line 84
    .local v3, width:I
    const/16 v4, 0x50

    .line 85
    .local v4, height:I
    new-instance v0, Lcom/netease/newsreader/util/BaseImageDownloader;

    const/4 v2, 0x0

    const-string v5, "Y"

    move-object v1, p0

    invoke-direct/range {v0 .. v5}, Lcom/netease/newsreader/util/BaseImageDownloader;-><init>(Landroid/content/Context;Landroid/graphics/Bitmap;IILjava/lang/String;)V

    iput-object v0, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->imageDownloader:Lcom/netease/newsreader/util/BaseImageDownloader;

    .line 86
    return-void
.end method

.method public onDestroy()V
    .locals 0

    .prologue
    .line 676
    invoke-super {p0}, Landroid/app/Service;->onDestroy()V

    .line 678
    return-void
.end method

.method public onStart(Landroid/content/Intent;I)V
    .locals 3
    .parameter "intent"
    .parameter "startId"

    .prologue
    .line 91
    invoke-super {p0, p1, p2}, Landroid/app/Service;->onStart(Landroid/content/Intent;I)V

    .line 93
    const-string v1, "OFFLINE"

    const-string v2, "OFFLINE"

    invoke-static {p0, v1, v2}, Lcom/netease/mobileanalysis/MobileAgent;->setEvent(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 95
    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 96
    .local v0, bundle:Landroid/os/Bundle;
    if-eqz v0, :cond_0

    .line 97
    const-string v1, "tid"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getStringArrayList(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v1

    iput-object v1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->tidList:Ljava/util/ArrayList;

    .line 98
    const-string v1, "tname"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getStringArrayList(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v1

    iput-object v1, p0, Lcom/netease/newsreader/service/OfflineDownloadService;->tnameList:Ljava/util/ArrayList;

    .line 102
    :cond_0
    new-instance v1, Lcom/netease/newsreader/service/OfflineDownloadService$2;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/service/OfflineDownloadService$2;-><init>(Lcom/netease/newsreader/service/OfflineDownloadService;)V

    .line 357
    invoke-virtual {v1}, Lcom/netease/newsreader/service/OfflineDownloadService$2;->start()V

    .line 358
    return-void
.end method
